package cn.skcks.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

@Controller
public class TestModel {

	@RequestMapping(value = "/testModel")
	public String test(HttpServletRequest request, HttpServletResponse response){
		HttpSession session = request.getSession();
		System.out.println(session.getId());
		return "test";
	}

	// 重定向
	@RequestMapping(value = "/testRedirect")
	public String testRedirect(HttpServletRequest request, HttpServletResponse response){
		HttpSession session = request.getSession();
		System.out.println(session.getId());
		return "redirect:test2";
	}
}